tool palette: Fix compiler warnings
authorMatthias Clasen <mclasen@redhat.com>
Sun, 31 May 2015 01:28:44 +0000 (21:28 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 2 Jun 2015 13:08:16 +0000 (09:08 -0400)
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.

gtk/gtktoolpalette.c

index 52f5bda2ccd3bbc9c159d2490de1b88d00c21a73..4d25292b4c9878f6fac70a49bcef47c785142d12 100644 (file)
@@ -621,13 +621,10 @@ gtk_tool_palette_size_allocate (GtkWidget     *widget,
   for (i = 0; i < palette->priv->groups->len; ++i)
     {
       GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
-      GtkWidget *widget;
 
       if (!group->widget)
         continue;
 
-      widget = GTK_WIDGET (group->widget);
-
       if (gtk_tool_item_group_get_n_items (group->widget))
         {
           gint size = group_sizes[i];
@@ -649,8 +646,8 @@ gtk_tool_palette_size_allocate (GtkWidget     *widget,
           else
             child_allocation.x = x;
 
-          gtk_widget_size_allocate (widget, &child_allocation);
-          gtk_widget_show (widget);
+          gtk_widget_size_allocate (GTK_WIDGET (group->widget), &child_allocation);
+          gtk_widget_show (GTK_WIDGET (group->widget));
 
           if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation)
             child_allocation.y += child_allocation.height;
@@ -658,7 +655,7 @@ gtk_tool_palette_size_allocate (GtkWidget     *widget,
             x += child_allocation.width;
         }
       else
-        gtk_widget_hide (widget);
+        gtk_widget_hide (GTK_WIDGET (group->widget));
     }
 
   if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation)